/*
 * XML Type:  TaxW2Request
 * Namespace: http://ofx.net/types/2003/04
 * Java type: net.ofx.types.x2003.x04.TaxW2Request
 *
 * Automatically generated - do not modify.
 */
package net.ofx.types.x2003.x04.impl;
/**
 * An XML TaxW2Request(@http://ofx.net/types/2003/04).
 *
 * This is a complex type.
 */
public class TaxW2RequestImpl extends org.apache.xmlbeans.impl.values.XmlComplexContentImpl implements net.ofx.types.x2003.x04.TaxW2Request
{
    
    public TaxW2RequestImpl(org.apache.xmlbeans.SchemaType sType)
    {
        super(sType);
    }
    
    private static final javax.xml.namespace.QName SSN$0 = 
        new javax.xml.namespace.QName("", "SSN");
    private static final javax.xml.namespace.QName TAXYEAR$2 = 
        new javax.xml.namespace.QName("", "TAXYEAR");
    
    
    /**
     * Gets the "SSN" element
     */
    public java.lang.String getSSN()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(SSN$0, 0);
            if (target == null)
            {
                return null;
            }
            return target.getStringValue();
        }
    }
    
    /**
     * Gets (as xml) the "SSN" element
     */
    public net.ofx.types.x2003.x04.GenericNameType xgetSSN()
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.GenericNameType target = null;
            target = (net.ofx.types.x2003.x04.GenericNameType)get_store().find_element_user(SSN$0, 0);
            return target;
        }
    }
    
    /**
     * Sets the "SSN" element
     */
    public void setSSN(java.lang.String ssn)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(SSN$0, 0);
            if (target == null)
            {
                target = (org.apache.xmlbeans.SimpleValue)get_store().add_element_user(SSN$0);
            }
            target.setStringValue(ssn);
        }
    }
    
    /**
     * Sets (as xml) the "SSN" element
     */
    public void xsetSSN(net.ofx.types.x2003.x04.GenericNameType ssn)
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.GenericNameType target = null;
            target = (net.ofx.types.x2003.x04.GenericNameType)get_store().find_element_user(SSN$0, 0);
            if (target == null)
            {
                target = (net.ofx.types.x2003.x04.GenericNameType)get_store().add_element_user(SSN$0);
            }
            target.set(ssn);
        }
    }
    
    /**
     * Gets array of all "TAXYEAR" elements
     */
    public java.util.Calendar[] getTAXYEARArray()
    {
        synchronized (monitor())
        {
            check_orphaned();
            java.util.List targetList = new java.util.ArrayList();
            get_store().find_all_element_users(TAXYEAR$2, targetList);
            java.util.Calendar[] result = new java.util.Calendar[targetList.size()];
            for (int i = 0, len = targetList.size() ; i < len ; i++)
                result[i] = ((org.apache.xmlbeans.SimpleValue)targetList.get(i)).getCalendarValue();
            return result;
        }
    }
    
    /**
     * Gets ith "TAXYEAR" element
     */
    public java.util.Calendar getTAXYEARArray(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(TAXYEAR$2, i);
            if (target == null)
            {
                throw new IndexOutOfBoundsException();
            }
            return target.getCalendarValue();
        }
    }
    
    /**
     * Gets (as xml) array of all "TAXYEAR" elements
     */
    public net.ofx.types.x2003.x04.YearType[] xgetTAXYEARArray()
    {
        synchronized (monitor())
        {
            check_orphaned();
            java.util.List targetList = new java.util.ArrayList();
            get_store().find_all_element_users(TAXYEAR$2, targetList);
            net.ofx.types.x2003.x04.YearType[] result = new net.ofx.types.x2003.x04.YearType[targetList.size()];
            targetList.toArray(result);
            return result;
        }
    }
    
    /**
     * Gets (as xml) ith "TAXYEAR" element
     */
    public net.ofx.types.x2003.x04.YearType xgetTAXYEARArray(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.YearType target = null;
            target = (net.ofx.types.x2003.x04.YearType)get_store().find_element_user(TAXYEAR$2, i);
            if (target == null)
            {
                throw new IndexOutOfBoundsException();
            }
            return (net.ofx.types.x2003.x04.YearType)target;
        }
    }
    
    /**
     * Returns number of "TAXYEAR" element
     */
    public int sizeOfTAXYEARArray()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().count_elements(TAXYEAR$2);
        }
    }
    
    /**
     * Sets array of all "TAXYEAR" element
     */
    public void setTAXYEARArray(java.util.Calendar[] taxyearArray)
    {
        synchronized (monitor())
        {
            check_orphaned();
            arraySetterHelper(taxyearArray, TAXYEAR$2);
        }
    }
    
    /**
     * Sets ith "TAXYEAR" element
     */
    public void setTAXYEARArray(int i, java.util.Calendar taxyear)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(TAXYEAR$2, i);
            if (target == null)
            {
                throw new IndexOutOfBoundsException();
            }
            target.setCalendarValue(taxyear);
        }
    }
    
    /**
     * Sets (as xml) array of all "TAXYEAR" element
     */
    public void xsetTAXYEARArray(net.ofx.types.x2003.x04.YearType[]taxyearArray)
    {
        synchronized (monitor())
        {
            check_orphaned();
            arraySetterHelper(taxyearArray, TAXYEAR$2);
        }
    }
    
    /**
     * Sets (as xml) ith "TAXYEAR" element
     */
    public void xsetTAXYEARArray(int i, net.ofx.types.x2003.x04.YearType taxyear)
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.YearType target = null;
            target = (net.ofx.types.x2003.x04.YearType)get_store().find_element_user(TAXYEAR$2, i);
            if (target == null)
            {
                throw new IndexOutOfBoundsException();
            }
            target.set(taxyear);
        }
    }
    
    /**
     * Inserts the value as the ith "TAXYEAR" element
     */
    public void insertTAXYEAR(int i, java.util.Calendar taxyear)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = 
                (org.apache.xmlbeans.SimpleValue)get_store().insert_element_user(TAXYEAR$2, i);
            target.setCalendarValue(taxyear);
        }
    }
    
    /**
     * Appends the value as the last "TAXYEAR" element
     */
    public void addTAXYEAR(java.util.Calendar taxyear)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().add_element_user(TAXYEAR$2);
            target.setCalendarValue(taxyear);
        }
    }
    
    /**
     * Removes the ith "TAXYEAR" element
     */
    public void removeTAXYEAR(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_element(TAXYEAR$2, i);
        }
    }
}
